home *** CD-ROM | disk | FTP | other *** search
/ Chip: Hang es video / CHIP_ZENESZERKESZTO_2005.ISO / audio_3 / visual / robotfunk / setup.exe / {app} / main.dxr / Internal_181.ls < prev    next >
Encoding:
Text File  |  2003-11-19  |  2.7 KB  |  106 lines

  1. property spriteNum, loop, numframes, inframe, outframe, mylist, Dir, pos, playin, oldpos, mycount, sn, maxframes
  2. global recording, composerect, composewidth, composeheight
  3.  
  4. on beginSprite me
  5.   loop = 0
  6.   mylist = []
  7.   numframes = 0
  8.   inframe = 1
  9.   outframe = 1
  10.   Dir = 1
  11.   pos = 0
  12.   oldpos = pos
  13.   playin = 0
  14.   mycount = 0
  15.   recording = 0
  16.   sn = sprite(spriteNum)
  17.   maxframes = 64
  18. end
  19.  
  20. on changelist me, whatlist
  21.   mylist = whatlist
  22.   if mylist = [] then
  23.     mylist = [image(composewidth, composeheight, 32)]
  24.   end if
  25.   inframe = 1
  26.   outframe = mylist.count
  27.   mycount = outframe
  28.   member("endfield").text = string(outframe)
  29.   pos = 1
  30.   sn.member.image.copyPixels(mylist[pos], sn.member.image.rect, mylist[pos].rect)
  31.   member("current_point_field").text = string(pos)
  32.   repeat with s = spriteNum - 1 to spriteNum + 21
  33.     sprite(s).visible = 1
  34.   end repeat
  35.   sprite(480).locH = 384
  36.   sprite(481).locH = 543
  37.   sprite(479).rect = rect(386, 167, 543, 173)
  38.   sprite(478).locH = 388
  39. end
  40.  
  41. on exitFrame me
  42.   if sn.visible then
  43.     if playin then
  44.       if not recording then
  45.         if mylist.count > 0 then
  46.           pos = pos + Dir
  47.           if pos < inframe then
  48.             if loop then
  49.               pos = outframe
  50.             else
  51.               pos = inframe
  52.               playin = 0
  53.             end if
  54.           else
  55.             if pos > outframe then
  56.               if loop then
  57.                 pos = inframe
  58.               else
  59.                 pos = outframe
  60.                 playin = 0
  61.               end if
  62.             else
  63.             end if
  64.           end if
  65.         end if
  66.       else
  67.         pos = pos + Dir
  68.         if pos > maxframes then
  69.           if loop then
  70.             pos = 1
  71.           else
  72.             recording = 0
  73.             pos = maxframes
  74.           end if
  75.         end if
  76.         if pos < 1 then
  77.           if loop then
  78.             pos = maxframes
  79.           else
  80.             recording = 0
  81.             pos = 1
  82.           end if
  83.         end if
  84.       end if
  85.     end if
  86.     if recording then
  87.       outframe = max(pos, outframe)
  88.       mycount = outframe
  89.       if pos > mylist.count then
  90.         mylist[pos] = image(composewidth, composeheight, 32)
  91.       end if
  92.       if mylist[pos].ilk <> #image then
  93.         mylist[pos] = image(composewidth, composeheight, 32)
  94.       end if
  95.       mylist[pos].copyPixels((the stage).image, composerect, composerect)
  96.     end if
  97.     if oldpos <> pos then
  98.       newloc = sprite(spriteNum + 10).left + (pos / float(mycount) * sprite(spriteNum + 10).width)
  99.       sprite(spriteNum + 11).locH = newloc
  100.       sprite(spriteNum).member.image.copyPixels(mylist[pos], sprite(spriteNum).member.image.rect, mylist[pos].rect)
  101.       member("current_point_field").text = string(pos)
  102.       oldpos = pos
  103.     end if
  104.   end if
  105. end
  106.